package com.lzy.huijinjiazu.mvp.ui.adapter;

import android.text.Html;
import android.view.View;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jess.arms.utils.ArmsUtils;
import com.lzy.huijinjiazu.R;
import com.lzy.huijinjiazu.mvp.model.entity.PayMode;

import org.w3c.dom.Text;

/**
 * Created by long on 2018/1/16.
 */

public class PaymentAdapter extends BaseQuickAdapter<PayMode, BaseViewHolder> {
    public PaymentAdapter() {
        super(R.layout.item_payment);
    }

    @Override
    protected void convert(BaseViewHolder helper, PayMode item) {
        ((ImageView) helper.getView(R.id.iv_payment)).setImageResource(item.getImg());
        ((TextView) helper.getView(R.id.tv_payment)).setText(item.getTitle());
        ((CheckBox) helper.getView(R.id.cb_check)).setChecked(item.isCheck());
        TextView tvMoney = ((TextView) helper.getView(R.id.tv_money));
        tvMoney.setVisibility(item.isCheck() ? View.VISIBLE : View.GONE);
        tvMoney.setText(Html.fromHtml(ArmsUtils.getString(mContext, R.string.symbol_moeny, "5000")));
    }
}
